import FreeCAD as App
import Draft
import math

# 创建新的文档
doc = App.newDocument()

# 定义圆心和半径
center = App.Vector(0, 0, -1)
r = 3

# 绘制圆
circle = Draft.make_circle(r, placement=App.Placement(center, App.Rotation(0, 0, 0), center))

center[2] = 0
# 计算八等分的直线的角度
for i in range(8):
    angle = i * 45  # 每个角度45度，八等分
    rad = angle * (math.pi / 180)  # 转换为弧度
    x = r * math.cos(rad)
    y = r * math.sin(rad)
    
    # 绘制从圆心到圆周的直线
    line = Draft.make_line(center, App.Vector(x, y, 0))

# 更新文档以显示
doc.recompute()